package com.xoa.controller.seal;

import com.xoa.model.seal.SealJingeKey;
import com.xoa.service.seal.SealJingeKeyService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by 张雨 on 2018/1/12.
 * 金格电子印章密钥盘管理
 */
@Controller
@RequestMapping("/sealJingeKey")
public class SealJingeKeyController {

    @Autowired
    SealJingeKeyService sealJingeKeyService;

    //新增签章授权管理
    @ResponseBody
    @RequestMapping("/addSealJingeKeyList")
    public ToJson<SealJingeKey> addSealJingeKeyList(HttpServletRequest request, SealJingeKey sealJingeKey){
        return sealJingeKeyService.addSealJingeKeyList(request, sealJingeKey);
    }

    //签章授权管理列表查询
    @ResponseBody
    @RequestMapping("/getSealJingeKeyList")
    public ToJson<SealJingeKey> getSealJingeKeyList(Integer sealId){
        return sealJingeKeyService.getSealJingeKeyList(sealId);
    }

    //签章授权详情
    @ResponseBody
    @RequestMapping("/getSealJingeKey")
    public ToJson<SealJingeKey> getSealJingeKey(Integer keyId){
        return sealJingeKeyService.getSealJingeKey(keyId);
    }

    //修改签章授权
    @ResponseBody
    @RequestMapping("/updateSealJingeKey")
    public ToJson<SealJingeKey> updateSealJingeKey(SealJingeKey sealJingeKey){
        return sealJingeKeyService.updateSealJingeKey(sealJingeKey);
    }

    //删除签章授权
    @ResponseBody
    @RequestMapping("/deleteSealJingeKey")
    public ToJson<SealJingeKey> deleteSealJingeKey(Integer keyId){
        return sealJingeKeyService.deleteSealJingeKey(keyId);
    }
}
